From 0f760f4823ecc624b00a3969f7bd35562b916901 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Mon, 24 Feb 2014 07:43:28 +0000 Subject: [PATCH] Fix leak on fatal error in dbfopen. Coverity is hyper. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4761 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/shapelib/dbfopen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpsbabel/shapelib/dbfopen.c b/gpsbabel/shapelib/dbfopen.c index 552b84377..1f717d3d1 100644 --- a/gpsbabel/shapelib/dbfopen.c +++ b/gpsbabel/shapelib/dbfopen.c @@ -686,8 +686,11 @@ DBFCreateLL( const char * pszFilename, const char * pszCodePage, SAHooks *psHook /* Create the file. */ /* -------------------------------------------------------------------- */ fp = psHooks->FOpen( pszFullname, "wb" ); - if( fp == NULL ) + if( fp == NULL ) { + free(pszBasename); + free(pszFullname); return( NULL ); + } psHooks->FWrite( &chZero, 1, 1, fp ); psHooks->FClose( fp ); -- 2.30.2